<?php
$header_titles = array(
        'event-view' => 'Event',
        'event-create' => 'New event',
        'home' => 'Discover'
);
$section = isset( $_GET['section'] ) ? $_GET['section'] :'home';
$title = $header_titles[$section];
?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
	<meta name="mobile-web-app-capable" content="yes">
	<title><?php echo $title; ?></title>
	<link href='http://fonts.googleapis.com/css?family=Roboto:400,300,700&amp;subset=latin' rel='stylesheet' type='text/css'>
	<link href="css/ripples.css" rel="stylesheet">
	<link href="css/material.css" rel="stylesheet">
	<link href="css/icons-material-design.css" rel="stylesheet">
	<link rel="stylesheet" href="css/main.css" />
</head>
<body>
	<section id="main-container">
		<header class="header">
			<a href="?section=home" class="icon-menu"><i class="icon-material-home"></i></a>

			<span class="right-buttons">
			<?php if( $section == 'home' ) { ?>
				<a href="?section=event-create"><i class="icon-material-add icon-menu"></i></a>
			<?php } ?>
			</span>

			<h1 id="section-title"><span class="title-corp">I'm in!</span> – <?php echo $title; ?></h1>
		</header>
		<div id="container" class="page">
			<?php
                switch ($section){
                    case 'event-create':
                        include __DIR__ . '/' . "event-create.php";
                        break;
                    case 'event-view':
                        include __DIR__ . '/' . "event-view.php";
                        break;
                    case 'home':
                    default:
                        include __DIR__ . '/' . "home.php";
                }

            ?>
		</div>
	</section>
	<script src="js/_jquery-1.8.3.min.js"></script>
	<script src="js/bootstrap.min.js"></script>
	<script src="js/ripples.js"></script>
	<script src="js/material.js"></script>
	<script src="app.js"></script>
<?php if( $section != 'home' ) { ?>
	<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places"></script>
<?php } ?>

	<script>
	  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
	  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
	  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
	  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

	  ga('create', 'UA-56383781-1', 'auto');
	  ga('send', 'pageview');
	</script>
</body>
</html>